package com.etime.shuhuiyuan.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.etime.shuhuiyuan.pojo.Lesson;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LessonDao extends BaseMapper<Lesson> {

//    /**
//     * 插入文本课时
//     * @param lesson
//     * @return
//     */
//    int insertTxtLesson(Lesson lesson);

    /**
     * 根据chapterid查询课时列表
     * @param chapterid
     * @return
     */
    @Select("select * from lesson where chapterid=#{chapterid} order by lessonsort")
    List<Lesson> selectLessonByChapterid(@Param("chapterid") Integer chapterid);
}
